import logging
from redis import StrictRedis


class Config(object):

    # 默认日志
    LOG_LEVEL = logging.DEBUG

    SECRET_KEY ='ac3SbyD28OSp/CUnmI5FBzEEvToGUfKAi1EwWU6WcGI/x4b+ezgWDC0aEBIjL70O'

    DEBUG = True
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost:3306/info_35'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 设置redis
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    # 设置session的配置信息
    SESSION_TYPE='redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT,db=1)
    SESSION_USE_SIGNER = True
    SESSION_PERMANENT_LIFETIME =  3600
    # session_permanent_lifetime


class DevelopmentConfig(Config):
    DEBUG = True


class ProductionConfig(Config):
    DEBUG = False


# 定义一个字典
config = {
    'development':DevelopmentConfig,
    'production':ProductionConfig
}